<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>Swift快速入门 | Swift 简介</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="克里斯·拉特纳">
        <meta name="generator" content="GitBook 2.1.0">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="gitbook/style.css">
    
    

        
    
    
    <link rel="next" href="./01-playground.html" />
    
    

        
    </head>
    <body>
        
        
    <div class="book" data-level="0" data-basepath="." data-revision="Sun Jul 26 2015 06:31:06 GMT+0800 (CST)">
    

<div class="book-summary">
    <div class="book-search">
        <input type="text" placeholder="Type to search" class="form-control" />
    </div>
    <ul class="summary">
        
        
        
        

        

        
    
        <li class="chapter active" data-level="0" data-path="index.html">
            
                
                    <a href="./index.html">
                        <i class="fa fa-check"></i>
                        
                        Swift快速入门
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.1" data-path="01-playground.html">
            
                
                    <a href="./01-playground.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.1.</b>
                        
                        Playground
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.2" data-path="02-var_and_let.html">
            
                
                    <a href="./02-var_and_let.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.2.</b>
                        
                        变量和常量
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.3" data-path="03-optional.html">
            
                
                    <a href="./03-optional.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.</b>
                        
                        Optional可选值
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4" data-path="04-control_flow.html">
            
                
                    <a href="./04-control_flow.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.</b>
                        
                        控制流
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.5" data-path="05-loop.html">
            
                
                    <a href="./05-loop.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.5.</b>
                        
                        循环
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6" data-path="06-string.html">
            
                
                    <a href="./06-string.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.</b>
                        
                        字符串
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.7" data-path="07-collection.html">
            
                
                    <a href="./07-collection.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.7.</b>
                        
                        集合
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.8" data-path="08-func.html">
            
                
                    <a href="./08-func.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.8.</b>
                        
                        函数
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.9" data-path="09-closure.html">
            
                
                    <a href="./09-closure.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.9.</b>
                        
                        闭包
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.10" data-path="10-init_func.html">
            
                
                    <a href="./10-init_func.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.10.</b>
                        
                        构造函数
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.11" data-path="11-lazy.html">
            
                
                    <a href="./11-lazy.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.11.</b>
                        
                        懒加载 &amp; didSet
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.12" data-path="12-ats.html">
            
                
                    <a href="./12-ats.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.12.</b>
                        
                        ATS
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    


        
        <li class="divider"></li>
        <li>
            <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                Published with GitBook
            </a>
        </li>
        
    </ul>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header">
    <!-- Actions Left -->
    <a href="#" class="btn pull-left toggle-summary" aria-label="Table of Contents"><i class="fa fa-align-justify"></i></a>
    <a href="#" class="btn pull-left toggle-search" aria-label="Search"><i class="fa fa-search"></i></a>
    
    <div id="font-settings-wrapper" class="dropdown pull-left">
        <a href="#" class="btn toggle-dropdown" aria-label="Font Settings"><i class="fa fa-font"></i>
        </a>
        <div class="dropdown-menu font-settings">
    <div class="dropdown-caret">
        <span class="caret-outer"></span>
        <span class="caret-inner"></span>
    </div>

    <div class="buttons">
        <button type="button" id="reduce-font-size" class="button size-2">A</button>
        <button type="button" id="enlarge-font-size" class="button size-2">A</button>
    </div>

    <div class="buttons font-family-list">
        <button type="button" data-font="0" class="button">Serif</button>
        <button type="button" data-font="1" class="button">Sans</button>
    </div>

    <div class="buttons color-theme-list">
        <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button>
        <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button>
        <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button>
    </div>
</div>

    </div>

    <!-- Actions Right -->
    
    <div class="dropdown pull-right">
        <a href="#" class="btn toggle-dropdown" aria-label="Share"><i class="fa fa-share-alt"></i>
        </a>
        <div class="dropdown-menu font-settings dropdown-left">
            <div class="dropdown-caret">
                <span class="caret-outer"></span>
                <span class="caret-inner"></span>
            </div>
            <div class="buttons">
                <button type="button" data-sharing="twitter" class="button">
                    Share on Twitter
                </button>
                <button type="button" data-sharing="google-plus" class="button">
                    Share on Google
                </button>
                <button type="button" data-sharing="facebook" class="button">
                    Share on Facebook
                </button>
                <button type="button" data-sharing="weibo" class="button">
                    Share on Weibo
                </button>
                <button type="button" data-sharing="instapaper" class="button">
                    Share on Instapaper
                </button>
            </div>
        </div>
    </div>
    

    
    <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Google"><i class="fa fa-google-plus"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Twitter"><i class="fa fa-twitter"></i></a>
    
    
    


    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="./" >Swift 简介</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="swift-%E7%AE%80%E4%BB%8B">Swift &#x7B80;&#x4ECB;</h1>
<h2 id="%E7%AE%80%E4%BB%8B">&#x7B80;&#x4ECB;</h2>
<ul>
<li>Swift &#x8BED;&#x8A00;&#x7531;&#x82F9;&#x679C;&#x516C;&#x53F8;&#x5728; 2014 &#x5E74;&#x63A8;&#x51FA;&#xFF0C;&#x7528;&#x6765;&#x64B0;&#x5199; OS X &#x548C; iOS &#x5E94;&#x7528;&#x7A0B;&#x5E8F;</li>
<li>2014 &#x5E74;&#xFF0C;&#x5728; Apple WWDC &#x53D1;&#x5E03;</li>
</ul>
<h3 id="%E5%8E%86%E5%8F%B2">&#x5386;&#x53F2;</h3>
<ul>
<li>2010 &#x5E74; 7 &#x6708;&#xFF0C;&#x82F9;&#x679C;&#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177;&#x90E8;&#x95E8;&#x603B;&#x76D1;<code>&#x514B;&#x91CC;&#x65AF;&#xB7;&#x62C9;&#x7279;&#x7EB3;</code>&#x5F00;&#x59CB;&#x7740;&#x624B; Swift &#x7F16;&#x7A0B;&#x8BED;&#x8A00;&#x7684;&#x8BBE;&#x8BA1;</li>
</ul>
<p><img src="http://a.hiphotos.baidu.com/baike/c0%3Dbaike80%2C5%2C5%2C80%2C26/sign=5fef538a272dd42a4b0409f9625230d0/a686c9177f3e670941f8431c39c79f3df9dc555c.jpg" alt="&#x514B;&#x91CC;&#x65AF;&#xB7;&#x62C9;&#x7279;&#x7EB3;"></p>
<ul>
<li>&#x7528;&#x4E00;&#x5E74;&#x65F6;&#x95F4;&#xFF0C;&#x5B8C;&#x6210;&#x57FA;&#x672C;&#x67B6;&#x6784;</li>
<li>Swift &#x5927;&#x7EA6;&#x5386;&#x7ECF; 4 &#x5E74;&#x7684;&#x5F00;&#x53D1;&#x671F;&#xFF0C;2014 &#x5E74; 6 &#x6708;&#x53D1;&#x5E03;</li>
<li>&#x8BA1;&#x5212;&#x5728; 2015 &#x5E74;&#x5E95;&#x5F00;&#x6E90;</li>
</ul>
<h3 id="%E7%89%88%E6%9C%AC">&#x7248;&#x672C;</h3>
<ul>
<li>&#x6B63;&#x5F0F;&#x7248; 1.2 Xcode 6.4</li>
<li>&#x6D4B;&#x8BD5;&#x7248; 2.0 Xcode 7.0 beta 4</li>
</ul>
<h3 id="swift-%E7%89%B9%E8%89%B2">Swift &#x7279;&#x8272;</h3>
<ul>
<li>&#x82F9;&#x679C;&#x5BA3;&#x79F0; Swift &#x7684;&#x7279;&#x70B9;&#x662F;&#xFF1A;&#x5FEB;&#x901F;&#x3001;&#x73B0;&#x4EE3;&#x3001;&#x5B89;&#x5168;&#x3001;&#x4E92;&#x52A8;&#xFF0C;&#x800C;&#x4E14;&#x660E;&#x663E;&#x4F18;&#x4E8E; Objective-C &#x8BED;&#x8A00;</li>
<li>&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x73B0;&#x6709;&#x7684; Cocoa &#x548C; Cocoa Touch &#x6846;&#x67B6;</li>
<li>Swift &#x53D6;&#x6D88;&#x4E86; Objective-C &#x7684;&#x6307;&#x9488;&#x53CA;&#x5176;&#x4ED6;&#x4E0D;&#x5B89;&#x5168;&#x8BBF;&#x95EE;&#x7684;&#x4F7F;&#x7528;</li>
<li>&#x820D;&#x5F03; Objective-C &#x65E9;&#x671F;&#x5E94;&#x7528; Smalltalk &#x7684;&#x8BED;&#x6CD5;&#xFF0C;&#x5168;&#x9762;&#x6539;&#x4E3A;&#x53E5;&#x70B9;&#x8868;&#x793A;&#x6CD5;</li>
<li>&#x63D0;&#x4F9B;&#x4E86;&#x7C7B;&#x4F3C; Java &#x7684;&#x540D;&#x5B57;&#x7A7A;&#x95F4;(namespace)&#x3001;&#x6CDB;&#x578B;(generic)&#x3001;&#x8FD0;&#x7B97;&#x5BF9;&#x8C61;&#x91CD;&#x8F7D;&#xFF08;operator overloading&#xFF09;</li>
<li>Swift &#x88AB;&#x7B80;&#x5355;&#x7684;&#x5F62;&#x5BB9;&#x4E3A; &#x201C;&#x6CA1;&#x6709; C &#x7684; Objective-C&#x201D;&#xFF08;Objective-C without the C&#xFF09;</li>
</ul>
<h2 id="swift-%E7%8E%B0%E7%8A%B6">Swift &#x73B0;&#x72B6;</h2>
<h3 id="%E5%A4%A7%E4%BA%8B%E4%BB%B6">&#x5927;&#x4E8B;&#x4EF6;</h3>
<ul>
<li>2014 &#x5E74; 6 &#x6708;&#x82F9;&#x679C;&#x5728;&#x53D1;&#x5E03; Xcode 6.0 &#x7684;&#x540C;&#x65F6;&#x53D1;&#x5E03;&#x4E86; Swift 1.0</li>
<li>2015 &#x5E74; 2 &#x6708;&#xFF0C;&#x82F9;&#x679C;&#x540C;&#x65F6;&#x63A8;&#x51FA; Xcode 6.2 Beta 5 &#x548C; 6.3 Beta&#xFF0C;&#x5728;&#x5B8C;&#x5584; Swift 1.1 &#x7684;&#x540C;&#x65F6;&#xFF0C;&#x63A8;&#x51FA;&#x4E86; Swift 1.2 &#x6D4B;&#x8BD5;&#x7248;</li>
<li>2015 &#x5E74; 6 &#x6708;&#xFF0C;&#x82F9;&#x679C;&#x53D1;&#x5E03;&#x4E86; Xcode 7.0 &#x548C; Swift 2.0 &#x6D4B;&#x8BD5;&#x7248;&#xFF0C;&#x5E76;&#x4E14;&#x5BA3;&#x79F0;&#x5728;&#x5E74;&#x5E95;&#x5F00;&#x6E90;</li>
</ul>
<p>&#x4ECE;&#x53D1;&#x5E03;&#x81F3;&#x4ECA;&#xFF0C;&#x82F9;&#x679C;&#x7684;&#x6BCF;&#x4E00;&#x4E2A;&#x4E3E;&#x63AA;&#x90FD;&#x5F70;&#x663E;&#x5176;&#x5927;&#x529B;&#x63A8;&#x5E7F; Swift &#x7684;&#x51B3;&#x5FC3;</p>
<blockquote>
<p>&#x4ECE;&#x53D1;&#x5E03;&#x81F3;&#x4ECA;&#xFF0C;&#x7531;&#x4E8E;&#x8BED;&#x6CD5;&#x66F4;&#x8FED;&#x592A;&#x5FEB;&#xFF0C;&#x6700;&#x82E6;&#x903C;&#x4E5F;&#x662F;&#x6536;&#x83B7;&#x6700;&#x5927;&#x7684;&#x83AB;&#x8FC7;&#x4E8E;&#x7528; Swift &#x5F00;&#x53D1;&#x6846;&#x67B6;&#x7684;&#x7A0B;&#x5E8F;&#x5458;&#x4EEC;</p>
</blockquote>
<h3 id="%E7%8E%B0%E7%8A%B6">&#x73B0;&#x72B6;</h3>
<ul>
<li>&#x76EE;&#x524D;&#x56FD;&#x5185;&#x6709;&#x4E9B;&#x516C;&#x53F8;&#x7684;&#x65B0;&#x9879;&#x76EE;&#x5DF2;&#x7ECF;&#x76F4;&#x63A5;&#x91C7;&#x7528; Swift &#x5F00;&#x53D1;</li>
<li>&#x76EE;&#x524D;&#x5F88;&#x591A;&#x516C;&#x53F8;&#x90FD;&#x5728;&#x505A; Swift &#x7684;&#x4EBA;&#x624D;&#x50A8;&#x5907;</li>
<li>&#x5E94;&#x8058;&#x65F6;&#xFF0C;&#x4F1A; Swift &#x5F00;&#x53D1;&#x65E0;&#x7591;&#x4F1A;&#x589E;&#x52A0;&#x81EA;&#x8EAB;&#x7B79;&#x7801;</li>
</ul>
<h3 id="%E5%BB%BA%E8%AE%AE">&#x5EFA;&#x8BAE;</h3>
<ul>
<li>Objective-C &amp; Swift &#x5BF9;&#x6BD4;&#x5B66;&#x4E60;&#x80FD;&#x591F;&#x5BF9;&#x82F9;&#x679C;&#x5E95;&#x5C42;&#x7684;&#x5F88;&#x591A;&#x5B9E;&#x73B0;&#x539F;&#x7406;&#x6709;&#x66F4;&#x52A0;&#x6DF1;&#x523B;&#x7684;&#x4F53;&#x4F1A;</li>
<li>&#x9879;&#x76EE;&#x8BFE;&#x7A0B;&#x7ED3;&#x675F;&#x540E;&#xFF0C;&#x5EFA;&#x8BAE;&#x7528; Objective-C &#x91CD;&#x5199;&#x9879;&#x76EE;</li>
</ul>
<h2 id="%E5%AD%A6%E4%B9%A0%E8%B5%84%E6%BA%90">&#x5B66;&#x4E60;&#x8D44;&#x6E90;</h2>
<ul>
<li>&#x82F9;&#x679C;&#x5B98;&#x65B9;&#x535A;&#x5BA2; <a href="https://developer.apple.com/swift/blog/" target="_blank">https://developer.apple.com/swift/blog/</a></li>
<li>&#x82F9;&#x679C;&#x5B98;&#x65B9;Swift 2.0&#x7535;&#x5B50;&#x4E66; <a href="https://itunes.apple.com/us/book/id1002622538" target="_blank">https://itunes.apple.com/us/book/id1002622538</a></li>
<li>1.0 &#x4E2D;&#x6587;&#x7248; <a href="http://numbbbbb.gitbooks.io/-the-swift-programming-language-/" target="_blank">http://numbbbbb.gitbooks.io/-the-swift-programming-language-/</a></li>
<li>100&#x4E2A;Swift&#x5FC5;&#x5907;tips&#xFF0C;&#x4F5C;&#x8005;&#x738B;&#x5DCD;&#xFF0C;&#x5EFA;&#x8BAE;&#x8D2D;&#x4E70;&#x5B9E;&#x4F53;&#x4E66;<a href="http://onevcat.com" target="_blank">http://onevcat.com</a></li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        
        <a href="./01-playground.html" class="navigation navigation-next navigation-unique" aria-label="Next page: Playground"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="gitbook/app.js"></script>

<script>
require(["gitbook"], function(gitbook) {
    var config = {"fontSettings":{"theme":null,"family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
